package dao.impl;

import dao.AppFunctionDao;
import domain.AppFunction;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import utils.JDBCUtils;
import utils.LyyLogUtil;

import java.util.List;

public class AppFunctionImpl implements AppFunctionDao {
    private JdbcTemplate template=new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<AppFunction> getAll() throws Exception {
        String sql="select * from app_function";
        List<AppFunction> list = null;
        try {
            list = template.query(sql, new BeanPropertyRowMapper<AppFunction>(AppFunction.class));
        } catch (Exception e) {
            LyyLogUtil.logeE(e.getMessage());
        }
        return list;
    }
}
